const wxglobal = {
  // 定义用户登录方法.
  setLang (langId) {

  },
  getTerminalType(call){
    call({"type":'3',"searialnumber":'fadf89e5ahsfjkdf8932423ifgkl'});
  },
  startBrowser (url) {
    window.location.href=url;
  },
  getVersion(call) {
    call({"code":0,"version":'0'});
  }
}

// 定义user模块的元 (meta) 信息.
const meta = {
  wxglobal: [{
    name: 'setLang',
    args: ['integer']
  },{
    name: 'startBrowser',
    args: ['string']
  },{
    name: 'getTerminalTypFe',
    args: ['function']
  },{
    name: 'getVersion',
    args: ['function']
  },]
}

export default {
  init (Weex) {
    // 注册这个模块，最后一个参数是模块的元信息.
    Weex.registerApiModule('wxglobal', wxglobal, meta)
    // console.log("注册中");
  }
}
